/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.uoc.tfc.exuoc.errors;

import edu.uoc.tfc.exuoc.controladors.GestorLogs ;
/**
 *
 * @author Emili A. Moreno Ruiz
 */
public class NoActiuException extends Exception {
    private String nomParam;
    private GestorLogs  log;


    public NoActiuException(String nomParam) {
        super("Objecte no actiu: '" + nomParam + "'");
        this.nomParam = nomParam;
        activarLog(this.getClass());
        log.error("Objecte no actiu: '" + nomParam + "'");
    }
    public NoActiuException(String nomParam,Class classe) {
        super(nomParam+" no actiu '");
        this.nomParam = nomParam;
        activarLog(classe);
        log.error(nomParam+" no actiu '");
    }

    private void activarLog(Class classe){
        this.log=GestorLogs.getLogger(classe.getName());
    }

    public String getNomParam() {
        return nomParam;
    }
 }

